﻿using System;

namespace Borg
{
    public enum DiscoveryChangeType
    {
        Add,
        Change,
        Remove
    }

    public class DiscoveryEventArgs : EventArgs
    {
        internal DiscoveryChangeType changeType;
        internal ContractInfo[] contracts;
        internal PluginInfo[] plugins;

        public DiscoveryEventArgs(DiscoveryChangeType changeType, ContractInfo[] contracts)
            : this(changeType, null, contracts)
        { }

        public DiscoveryEventArgs(DiscoveryChangeType changeType, PluginInfo[] plugins)
            : this(changeType, plugins, null)
        { }

        public DiscoveryEventArgs(DiscoveryChangeType changeType, PluginInfo[] plugins, ContractInfo[] contracts)
        {
            this.changeType = changeType;
            this.plugins = plugins;
            this.contracts = contracts;
        }

        public DiscoveryChangeType ChangeType
        {
            get { return changeType; }
        }

        public ContractInfo[] ContractInfos
        {
            get { return contracts; }
        }

        public PluginInfo[] PluginInfos
        {
            get { return plugins; }
        }
    }

    public delegate void DiscoveryEventHandler(object sender, DiscoveryEventArgs args);
}

